//
//  NewsViewController.m
//  Product_NEWS
//
//  Created by dllo on 15/12/28.
//  Copyright © 2015年 FCH. All rights reserved.
//

#import "NewsViewController.h"
#import "HeadLineViewController.h"
#import "EntertainmentViewController.h"
#import "FinanceViewController.h"
#import "HouseViewController.h"
#import "ScienceViewController.h"
#import "SocietyViewController.h"
#import "SCNavTabBarController.h"
#import "UIBarButtonItem+gyh.h"
#import "SearchViewController.h"
@interface NewsViewController ()

@end

@implementation NewsViewController




- (void)viewDidLoad {
    [super viewDidLoad];
 
 
    self.view.backgroundColor = [NightModeHandle shareNightModeHandle].allViewColor;
    
    
    
    
    
    
    NSLog(@"%@",self.navigationItem.title);
  //头条
    HeadLineViewController *headLineViewController = [[HeadLineViewController alloc]init];
    headLineViewController.title = @"头条";
    
    
    //娱乐
    EntertainmentViewController *entertainmentViewController = [[EntertainmentViewController alloc]init];
    entertainmentViewController.title = @"娱乐";
    
  
    
    FinanceViewController *financeViewController = [[FinanceViewController alloc]init];
    
    financeViewController.title =@"财经";
    
    HouseViewController *houseViewController = [[HouseViewController alloc]init];
    houseViewController.title = @"家居";
    
  
    
    ScienceViewController *scienceViewController = [[ScienceViewController alloc]init];
    scienceViewController.title = @"科技";
    
    SocietyViewController *societyViewController = [[SocietyViewController alloc]init];
    
    societyViewController.title = @"社会";
    

    
     UIBarButtonItem *sou  = [UIBarButtonItem ItemWithIcon:@"sou" highIcon:nil target:self action:@selector(rightAction:)];
    

    self.navigationItem.rightBarButtonItems = [NSArray arrayWithObjects:sou, nil];
    SCNavTabBarController *scn = [[SCNavTabBarController alloc]init];
    scn.navTabBarColor = [NightModeHandle shareNightModeHandle].allViewColor;
    
    scn.subViewControllers = @[headLineViewController,entertainmentViewController,financeViewController,houseViewController,scienceViewController,societyViewController];
    scn.showArrowButton = YES;
    [scn addParentController:self];
    [scn release];
    [headLineViewController release];
    [entertainmentViewController release];
    [entertainmentViewController release];
    [financeViewController release];
    [houseViewController release];
    [scienceViewController release];
    [societyViewController release];
   
    
}

-(void)rightAction:(UIButton *)btn{
    
    SearchViewController *vc = [[SearchViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
